#include <cstdio>
#include <ctime>

using namespace std;

class date
{
	public:
		date(char NewD[]);
		date(int NewY, int NewM, int NewD);
		date();
		void show();
	
	private:
		int y, m, d;
};

date::date(char NewD[])
{
	sscanf(NewD, "%d-%d-%d", &y, &m, &d);
}

date::date(int NewY, int NewM, int NewD)
{
	y = NewY;
	m = NewM;
	d = NewD;
}

date::date()
{
	time_t raw_time = time(nullptr);
	struct tm *info = localtime(&raw_time);
	y = 1900 + info->tm_year;
	m = 1 + info->tm_mon;
	d = info->tm_mday;
}

void date::show()
{
	printf("%04d-%02d-%02d\n", y, m, d);
}

int main()
{
	date d1, d2(2011, 3, 8), d3((char*) "2011-03-19");

	d1.show();
	d2.show();
	d3.show();

	return 0;
}
